import {Global} from "@app/global.component";

class Store {
  public global: Global | undefined;
  public products: Array<Product> = [
    {
      id: 1,
      name: 'Samsung Galaxy S20 Ultra',
      price: 1200,
      description: 'The Samsung Galaxy S20 Ultra is the latest flagship smartphone from Samsung, and it is powered by the Exynos 990 chipset. It has a 6.9-inch AMOLED display with a'
    },
    {
      id: 2,
      name: 'iPhone 12 Pro',
      price: 1100,
      description: 'The iPhone 12 Pro is the latest'
    },
    {
      id: 3,
      name: 'Samsung Galaxy S21 Ultra',
      price: 1400,
      description: 'The Samsung Galaxy S21 Ultra is the latest ' +
        'flagship smartphone from Samsung, and it is powered by ' +
        'the Exynos 980 chipset. It has a 6.'
    }

  ];
  // public recordHistory: Array<{ name: string, count: number }> = [];
  private _recordHistoryMap: { [name: string]: number } = {};
  public recordHistoryMap = new Proxy(this._recordHistoryMap, {
    get(target: { [p: string]: number }, p: string, receiver: any): any {
      if (!target[p])
        target[p] = 0;
      return target[p];
    }
  });
  //标准分辨率高度对比现在分辨率高度的比例
  public WHPercentage: { width: number, height: number } = {
    width: window.innerWidth - window.innerHeight / 1080 * 1920,
    height: window.innerHeight / 1080
  }

}

const store = new Store();
export default store;
